\section{any --- Test for non-zero matrix}
\label{fn:any}
\index{any()}
\index{test for non-zero matrix}
\index{matrix!test}
\begin{rail}
Any : 'any' '(' ( Scalar | Matrix ) ')' ;
\end{rail}

\verb+any+ tests for non-zero arguments.  If the argument is a scalar,
the result is $0$ if the argument is $0$ - otherwise the result is
$1$.  If the argument is a row or column vector, \verb+any+ returns
a $1$ if any of the elements are non-zero.  If the argument is some
other kind of matrix, \verb+any+ returns a row vector produced
by performing the test on each column of the matrix in turn.

\paragraph{Example}
\index{example of any()}
\index{any()!example}
\begin{verbatim}
> a = [ 0,3,4,4,0]
 a =
        0          3          4          4          0  
> any(a)
        1  
> b = [0,0,0]
 b =
        0          0          0  
> any(b)
        0  
> c = [a;b,6,0]
 c =
        0          3          4          4          0  
        0          0          0          6          0  
> any(c)
        0          1          1          1          0  
> any(any(c))
        1  
\end{verbatim}

See also: Page~\pageref{fn:all} \verb+all()+.

\newpage 




